From fec35adc8693a574a5fa77f06c56916a6e185043 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 2 Jul 2008 17:28:27 +0100 Subject: [PATCH] iommu: Fix hvm_dpci_eoi for smp guest in ioapic interrupt mode My testing shows, for some smp guests, ent->fields.mask will not be unmasked when hvm_dpci_eoi() is invoked at the first time. In that case, we should rely on timeout call back to do pirq_guest_eoi() and should not stop the per-irq timer too early. From: Wei Wang Signed-off-by: Keir Fraser --- xen/drivers/passthrough/io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 7e38237907..422ae18a0e 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -258,10 +258,12 @@ void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi, { spin_unlock(&hvm_irq_dpci->dirq_lock); - stop_timer(&hvm_irq_dpci->hvm_timer[ - domain_irq_to_vector(d, machine_gsi)]); if ( (ent == NULL) || !ent->fields.mask ) + { + stop_timer(&hvm_irq_dpci->hvm_timer[ + domain_irq_to_vector(d, machine_gsi)]); pirq_guest_eoi(d, machine_gsi); + } } else spin_unlock(&hvm_irq_dpci->dirq_lock); -- 2.30.2